//client
//
//Ky Halverson

#include"masterSocket.cpp"
#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <errno.h>
#include <signal.h>
#include <unistd.h>
#include <string.h>
#include <netinet/in.h>

#define PORT 2038
#define IP "127.0.0.1"
#define TYPE "UDP"


using namespace std;

int main()
{
	masterSocket* clientSocket;
	clientSocket = new masterSocket(IP, PORT, TYPE);
	string message;
	string messageBack; 

	
		while(true)
		{
			std::cout<<"What do you want the server to know?(type without quotes \"Exit\" to kill client and server!)"<<std::endl;
			getline(cin,message);
			clientSocket->sendIt("CLIENT",message);
			if (message == "Exit")
			{
				break;
			}
			messageBack = clientSocket->recvIt("CLIENT");
			std::cout<<"\nSERVER: "<<messageBack<<"\n"<<std::endl;

		}

	



return 0; 
}
